from utils.orm_base import OrmData
from spark.analyze_models import frequency_analysis, gender_analysis, water_army_analysis, analyzed_room
from spark.models import LiveRoom
import asyncio


async def run():
    # 初始化数据库连接
    orm = OrmData()
    await orm.init()

    result_list = await analyzed_room.all().values_list('room_id', 'analyzed_date')
    result_dict_list = [dict(room_id=room_id, analyzed_date=analyzed_date)
                        for room_id, analyzed_date in result_list]

    print(result_dict_list)
    # 关闭数据库连接
    await orm.close()

if __name__ == '__main__':
    asyncio.run(run())
